﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PPAPNews.aspx.cs" Inherits="PPAP.Web.Master.PPAPNews" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script language="javascript">
        function add() {
            url = "PPAPNewsEdit.aspx";
            //            PopUpWindow(url, 230, 160, 730, 420);
            window.location.href = url;
        }
        function edit(id) {
            url = "PPAPNewsEdit.aspx?ID=" + id;
            //            PopUpWindow(url, 230, 160, 730, 420);
            window.location.href = url;
        }
        function view(id) {
            url = "PPAPNewsShow.aspx?ID=" + id;
            PopUpWindow(url, 300, 50, 720, 650);
            //window.location.href = url;
        }
        function del(id) {
            if (confirm('Please confirm to delete the file.')) {
                url = "PPAPNews.aspx?deid=" + id;
                window.location.href = url;
            }
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="form1" runat="server">
    <font size='-1' color='gray'>Current position:Admin>>News</font>
    <div>
    <br />
        <table width="100%">
            <tr>
                <td colspan="2" style="font-weight: bold; font-size:11pt; font-family:Arial; color: #2E8AC5;">
                    Welcome<hr />
                </td>
            </tr>
            <tr>
                <td width="60%">
                    <asp:Label ID="lblWelcome" runat="server" Text="lblWelcome"></asp:Label>
                </td>
                <td align="right" runat="server" id="td2">
                    <input value="Edit" onclick="javascript:edit(1);" class="button" type="button" />
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td style="font-weight: bold; font-size:11pt; font-family:Arial; color: #2E8AC5;">
                    News & release<hr />
                </td>
            </tr>
            <tr>
                <td align="right" runat="server" id="td1">
                    <input value="Add" onclick="javascript:add();" class="button" type="button" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="No." HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Title" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("Title") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Created by" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("CREATEDBY") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Type" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%#Eval("Type").ToString()=="1"?"For BDNT":Eval("Type").ToString()=="2"?"For all":"For supplier"  %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Createtime" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%#Eval("Createtime").ToString()==""?"":DateTime.Parse(Eval("Createtime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="ID" HeaderStyle-Font-Size="12px" Visible="false"
                    HeaderText="Edit" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"
                    DataNavigateUrlFormatString="MailTemplate.aspx?ID={0}" Text="Edit" />
                <asp:TemplateField HeaderText="View" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton3" Visible="false" PostBackUrl='<%#"javascript:edit("+Eval("ID")+");" %>'
                            runat="server">Edit</asp:LinkButton>
                        <img src="../Images/newimg/see.png" title="View" onclick="<%#"javascript:view("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Edit" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl='<%#"javascript:edit("+Eval("ID")+");" %>'
                            runat="server">Edit</asp:LinkButton>
                        <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" Visible="false" runat="server" OnClientClick="return confirm('Please confirm to delete the file.')"
                            PostBackUrl='<%# "MailTemplateList.aspx?deid="+Eval("ID") %>'>Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2E8AC5" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Left" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" CssClass="paginator" ShowPageIndexBox="Always"
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto" HorizontalAlign="Center"
            PageSize="20" EnableTheming="true" AlwaysShow="True" FirstPageText="|&lt;" LastPageText="&gt;|"
            NextPageText="&gt;" PrevPageText="&lt;" SubmitButtonText="Go" TextAfterPageIndexBox="page"
            InvalidPageIndexErrorMessage="Page index is not effective numerical！" OnPageChanged="AspNetPager2_PageChanged"
            PageIndexOutOfRangeErrorMessage="Page index beyond range" BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
